<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="show">点击显示msg</button>
    <School ref="school" id="sch"/>
  </div>
</template>

<script>
import School from "./components/School.vue";
export default {
  name: "App",
  components: {
    School,
  },
  data () {
    return {
      msg:"789"
    }
  },
  methods: {
    show(){
      console.log(this.$refs.title)//真实dom
      console.log(this.$refs.school)//真实dom
      console.log(document.getElementById("sch"))//School组件实例的对象（vc）
      //alert(this.$refs.title)
    }
  }
};
</script>

<style>
</style>